package com.ljm.boot.rabbitmq.comsumer;

import com.ljm.boot.rabbitmq.constant.*;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * 消息接收者
 */
@Component
public class DirectConeumer {
    /***
     *
     * @param msg

    @RabbitListener(queues = RabbitMQConstant.DIRECT_QUEUE_1)
    public void queue_direct1(Object msg){
        System.out.println("从 queue_direct1 接收消息-" + msg);
    }

    @RabbitListener(queues = RabbitMQConstant.DIRECT_QUEUE_2)
    public void queue_direct2(Object msg){
        System.out.println("从 queue_direct2 接收消息-" + msg);
    }
 */

    @RabbitListener(queues  = "direct.queue")
    public void queue_direct1(Object msg){

        System.out.println("从 queue_direct1 接收消息-" + msg);
    }
}

